﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Foundation;

namespace BusinessEntity
{
    public class GDocsBase
    {

        #region Delegate Section
        //public delegate void MsgArrivedEventHandler(string sender, string message);
        //public virtual event MsgArrivedEventHandler MsgArrivedEvent;

        //public delegate void HTMLMsgArrivedEventHandler(string HTML);
        //public virtual event HTMLMsgArrivedEventHandler HTMLMsgArrivedEvent;

        //public delegate void ExceptionEventHandler(Exception ex);
        //public virtual event ExceptionEventHandler ExceptionEvent;

        public delegate void LoginRequiredEventHandler();
        public virtual event LoginRequiredEventHandler LoginRequiredEvent;

        #endregion

        //internal void CreateHTML(string lsHTML)
        //{
        //    if (HTMLMsgArrivedEvent != null)
        //    {
        //        HTMLMsgArrivedEvent(lsHTML);
        //    }
        //}

        //internal void CreateMessage(string sender, string message)
        //{
        //    if (MsgArrivedEvent != null)
        //    {
        //        MsgArrivedEvent(sender, message);
        //    }
        //}

        //internal void CreateException(Exception ex)
        //{
        //    if (ExceptionEvent != null)
        //    {
        //        ExceptionEvent(ex);
        //    }
        //}

        internal void CreateLoginRequiredEvent()
        {
            if (Constant.GCredentials == null)
            {
                if (LoginRequiredEvent != null)
                {
                    LoginRequiredEvent();
                }
            }


        }

    }
}
